#include "KeyboardEvent.h"

/**
 * Initializes the KeyboardEvent.
 * 
 * @param type: type of the keyboard event.
 * @param key: key that triggered the event.
 * @param mod: modifiers applied when the key triggered the event.
 * @param unicode: unicode value of the key pressed.
 */
    
KeyboardEvent::KeyboardEvent(KeyboardEventType type, Key key, KeyMod mod, Uint16 unicode)
:
m_evtType(type),
m_key(key),
m_modifier(mod),
m_unicode(unicode)
{
}


KeyboardEvent::~KeyboardEvent()
{
}


/**
 * Returns the type of the event.
 * 
 * @retval KEY_PRESSED: a key press triggered the Keyboard Event.
 * @retval KEY_RELEASED: a key that was released triggered the Keyboard Event.
 */
    
KeyboardEventType KeyboardEvent::GetType() const
{
    return m_evtType;
}
    

/**
 * Returns the key that triggered the Keyboard Event.
 * 
 * @return the SDLkey that was pressed or released.
 */

Key KeyboardEvent::GetKey() const
{
    return m_key;
}


/**
 * Returns the modifiers applied flag.
 * 
 * @return a flag indicating the modifiers applied to the key that triggered
 *         the Keyboard Event.
 *         The flag is a bitwise or of these values:
 *         
 *         KMOD_NONE
 * 	   KMOD_LSHIFT
 * 	   KMOD_RSHIFT
 *         KMOD_LCTRL
 * 	   KMOD_RCTRL
 *         KMOD_LALT
 *         KMOD_RALT
 *         KMOD_LMETA
 *         KMOD_RMETA
 *         KMOD_NUM
 *         KMOD_CAPS
 *         KMOD_MODE
 *         KMOD_CTRL 
 *         KMOD_SHIFT
 *         KMOD_ALT
 *         KMOD_META
 */
    
KeyMod KeyboardEvent::GetModifiers() const
{
    return m_modifier;
}


/**
 * @return unicode value of the key that triggered this event.
 */

Uint16 KeyboardEvent::GetUnicode() const
{
    return m_unicode;
}
